Note:All functions return a value > 0 if they succeed, and an error code < 0 in case of problems. You can use iimGetLastMessage to retrieve the text associated with the last error.
iimDisplay ("Hello")
This message is displayed in the Internet Macros browser. A typical usage would be to distinguish several running IIM browsers or display information on the current position within the script. If you want to hide the display so that you can manually trigger macros with the PLAY button please use iimDisplay ("#HIDEDISPLAY")
iimExit()
Close the Internet Macros browser
iimGetLastMessage()
Returns the text associated with the last error.
If the last command was iimPlay and if EXTRACT is used inside a macro iimGetLastMessage returns the extracted text. If the EXTRACT command can not find the extraction anchor, a "Extraction anchor not found (#EANF#)" message is returned. See iimPlay for more details.
iimInit()
Initialize the scripting interface.
Tip1: Use iimInit ("-tray") to start IIM in tray mode.
Tip2: If you want your script to connect to an already running instance of the IIM browser, use iimInit ("", FALSE). A typical use for this feature is if you manually log into a website and then start the script/macro to do some work on the currently active web page.
iimPlay ("mymacro")
Play the macro! After the macro has played all options that have been set with the iimSet command are reset.
Specific return values:
1: Macro completed without problems
2: Macro completed and data extracted,
Use iimGetLastMessage to get the extracted text. Please note that if one or more EXTRACT commands fail, the return code is also "2" but the string returned by iimGetLastMessage contains the #EANF# tag.
<0: Error encountered, use iimGetLastMessage to get the error message.
Important Error Return Codes:
-1 Macro timeout. The macro is not completed within the specified time. Default value is 600s (10 min). This value can be changed with iimSetInternal ("MACROTIMEOUT", <new value>).
-2 IIM Interface timeout: The IIM browser does not respond to the IIM browser. This error can happen when the IIM browser is very busy for a long time, for example while extracting a very large amount of data from a web page. The timeout default value is 10s. This value can be changed with iimSetInternal ("INTERFACETIMEOUT", <new value>).
-3 User pressed STOP button: The macro was stopped by a user that clicked the STOP button
-4 Communication error. The IIM browser did not receive the last command completely.
-5 IIM browser closed: The Scripting Interface can not find the IIM browser. Typically this happens if a user closes the IIM browser.
Error codes below -100 are error codes generated during the macro replay. These are the same error codes that you get during a manual macro replay.
iimSet ("-xx", "value")
Store values and settings that are used when Internet Macros is started. You can use exactly the same commands as for the command line interface. After iimPlay all settings are erased.
Example:
iimSet("-var1", "Tom") => Fills the variable{{!VAR1}} with Tom
iimSet("-var_ZIP", "44051") => Creates & fills the variable{{ZIP}} with "44051"
iimSet("-tray", "") => Activates the TRAY mode